
lt = list(map(int,input().split()))
len = len(lt)
dp = [1 for i in range(len)]
for i in range(len):
    for j in range(i):
        if lt[i] > lt[j]:     #s[i] 是当前的数字,j是动态的
            dp[i] = max(dp[i],dp[j]+1)
k=max(dp)
print(k)
